package com.lingyu.jsjx.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lingyu.jsjx.mapper.ExpertEmploymentMapper;
import com.lingyu.jsjx.domain.ExpertEmployment;
import com.lingyu.jsjx.service.IExpertEmploymentService;

/**
 * 专家任职档案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-08
 */
@Service
public class ExpertEmploymentServiceImpl  extends ServiceImpl<ExpertEmploymentMapper, ExpertEmployment> implements IExpertEmploymentService
{
    @Autowired
    private ExpertEmploymentMapper expertEmploymentMapper;

    /**
     * 查询专家任职档案
     * 
     * @param expertId 专家任职档案主键
     * @return 专家任职档案
     */
    @Override
    public ExpertEmployment selectExpertEmploymentByExpertId(Long expertId)
    {
        return expertEmploymentMapper.selectExpertEmploymentByExpertId(expertId);
    }

    /**
     * 查询专家任职档案列表
     * 
     * @param expertEmployment 专家任职档案
     * @return 专家任职档案
     */
    @Override
    @DataScope(deptAlias = "u", userAlias = "ee",type = "jsjx")
    public List<ExpertEmployment> selectExpertEmploymentList(ExpertEmployment expertEmployment)
    {
        return expertEmploymentMapper.selectExpertEmploymentList(expertEmployment);
    }

    /**
     * 新增专家任职档案
     * 
     * @param expertEmployment 专家任职档案
     * @return 结果
     */
    @Override
    public int insertExpertEmployment(ExpertEmployment expertEmployment)
    {
        return baseMapper.insert(expertEmployment);
    }

    /**
     * 修改专家任职档案
     * 
     * @param expertEmployment 专家任职档案
     * @return 结果
     */
    @Override
    public int updateExpertEmployment(ExpertEmployment expertEmployment)
    {

        return baseMapper.updateById(expertEmployment);
    }

    /**
     * 批量删除专家任职档案
     * 
     * @param expertIds 需要删除的专家任职档案主键
     * @return 结果
     */
    @Override
    public int deleteExpertEmploymentByExpertIds(Long[] expertIds)
    {
        return expertEmploymentMapper.deleteExpertEmploymentByExpertIds(expertIds);
    }

    /**
     * 删除专家任职档案信息
     * 
     * @param expertId 专家任职档案主键
     * @return 结果
     */
    @Override
    public int deleteExpertEmploymentByExpertId(Long expertId)
    {
        return baseMapper.deleteById(expertId);
    }
}
